<!DOCTYPE html>
<html><head>
	<meta charset="UTF-8">
	<meta http-equiv="x-UA-Compatible" content="ie=Edge">
   	<meta name="viewport" content="width=device-width, initial-scale=1">
   	<title>Crafty - Text</title>
	<link type="text/css" rel="stylesheet" href="../craftyjs-site.css">
	<link rel="shortcut icon" href="../favicon.ico">
</head>
<body>
	<div id="header-background"> </div>
	<div id="page-frame">
	<div id="header">
		<nav class="navbar">
  			<div class="container-fluid">
  				<div class="navbar-header">
  					<a class="navbar-brand" href="../"> <img class="logo" src="../images/text-logo.png"> </a>
  					
				</div>
				<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li><a href="../">首页</a></li>
						<li><a href="../getting-started/">快速开始</a></li>
						<li><a href="../documentation/">文档</a></li>
						<li><a href="../api/">API</a></li>
						<li><a href="../components/">组件</a></li>
						<li class="emph"><a href="../#install">下载</a></li>
					</ul>
				</div>
			</div>
		</nav>
	</div>


	<div id="main">
		<div id="content" class="container">
			



<div id="docs"><div class="toc-holder" id="doc-nav"><ul id="doc-level-one"><li><a href="events.html">事件列表</a></li><li class="category">核心<ul class="category-list"><li><a href="Crafty.html">Crafty</a></li><li><a href="Crafty Core.html">Crafty Core</a></li><li><a href="Crafty-bind.html">Crafty.bind()</a></li><li><a href="Crafty-c.html">Crafty.c()</a></li><li><a href="Crafty-clone.html">Crafty.clone()</a></li><li><a href="Crafty-defineField.html">Crafty.defineField()</a></li><li><a href="Crafty-e.html">Crafty.e()</a></li><li><a href="Crafty-extend.html">Crafty.extend()</a></li><li><a href="Crafty-frame.html">Crafty.frame()</a></li><li><a href="Crafty-getVersion.html">Crafty.getVersion()</a></li><li><a href="Crafty-init.html">Crafty.init()</a></li><li><a href="Crafty-isPaused.html">Crafty.isPaused()</a></li><li><a href="Crafty-one.html">Crafty.one()</a></li><li><a href="Crafty-pause.html">Crafty.pause()</a></li><li><a href="Crafty-s.html">Crafty.s()</a></li><li><a href="Crafty-settings.html">Crafty.settings</a></li><li><a href="Crafty-stage.html">Crafty.stage</a></li><li><a href="Crafty-stop.html">Crafty.stop()</a></li><li><a href="Crafty-support.html">Crafty.support</a></li><li><a href="Crafty-trigger.html">Crafty.trigger()</a></li><li><a href="Crafty-unbind.html">Crafty.unbind()</a></li><li><a href="Crafty-uniqueBind.html">Crafty.uniqueBind()</a></li></ul></li><li class="category">2D<ul class="category-list"><li><a href="2D.html">2D</a></li><li><a href="AngularMotion.html">AngularMotion</a></li><li><a href="Collision.html">Collision</a></li><li><a href="Crafty-circle.html">Crafty.circle</a></li><li><a href="Crafty-diamondIso.html">Crafty.diamondIso</a></li><li><a href="Crafty-HashMap.html">Crafty.HashMap</a></li><li><a href="Crafty-isometric.html">Crafty.isometric</a></li><li><a href="Crafty-map.html">Crafty.map</a></li><li><a href="Crafty-math-Matrix2D.html">Crafty.math.Matrix2D</a></li><li><a href="Crafty-math-Vector2D.html">Crafty.math.Vector2D</a></li><li><a href="Crafty-polygon.html">Crafty.polygon</a></li><li><a href="Crafty-raycast.html">Crafty.raycast()</a></li><li><a href="Crafty-rectManager.html">Crafty.rectManager</a></li><li><a href="Gravity.html">Gravity</a></li><li><a href="GroundAttacher.html">GroundAttacher</a></li><li><a href="Motion.html">Motion</a></li><li><a href="Supportable.html">Supportable</a></li></ul></li><li class="category">动画<ul class="category-list"><li><a href="Crafty-easing.html">Crafty.easing</a></li><li><a href="SpriteAnimation.html">SpriteAnimation</a></li><li><a href="Tween.html">Tween</a></li></ul></li><li class="category">资源<ul class="category-list"><li><a href="Crafty-asset.html">Crafty.asset()</a></li><li><a href="Crafty-assets.html">Crafty.assets</a></li><li><a href="Crafty-imageWhitelist.html">Crafty.imageWhitelist()</a></li><li><a href="Crafty-load.html">Crafty.load()</a></li><li><a href="Crafty-paths.html">Crafty.paths()</a></li><li><a href="Crafty-removeAssets.html">Crafty.removeAssets()</a></li></ul></li><li class="category">音频<ul class="category-list"><li><a href="Crafty-audio.html">Crafty.audio</a></li></ul></li><li class="category">控制器<ul class="category-list"><li><a href="Controllable.html">Controllable</a></li><li><a href="Controls.html">Controls</a></li><li><a href="Draggable.html">Draggable</a></li><li><a href="Fourway.html">Fourway</a></li><li><a href="Jumper.html">Jumper</a></li><li><a href="Multiway.html">Multiway</a></li><li><a href="Twoway.html">Twoway</a></li></ul></li><li class="category">调试<ul class="category-list"><li><a href="Crafty-error.html">Crafty.error()</a></li><li><a href="Crafty-log.html">Crafty.log()</a></li><li><a href="DebugCanvas.html">DebugCanvas</a></li><li><a href="DebugPolygon.html">DebugPolygon</a></li><li><a href="DebugRectangle.html">DebugRectangle</a></li><li><a href="SolidAreaMap.html">SolidAreaMap</a></li><li><a href="SolidHitBox.html">SolidHitBox</a></li><li><a href="VisibleMBR.html">VisibleMBR</a></li><li><a href="WiredAreaMap.html">WiredAreaMap</a></li><li><a href="WiredHitBox.html">WiredHitBox</a></li></ul></li><li class="category">事件<ul class="category-list"><li><a href="Crafty-addEvent.html">Crafty.addEvent()</a></li><li><a href="Crafty-bind.html">Crafty.bind()</a></li><li><a href="Crafty-one.html">Crafty.one()</a></li><li><a href="Crafty-removeEvent.html">Crafty.removeEvent()</a></li><li><a href="Crafty-trigger.html">Crafty.trigger()</a></li><li><a href="Crafty-unbind.html">Crafty.unbind()</a></li><li><a href="Crafty-uniqueBind.html">Crafty.uniqueBind()</a></li></ul></li><li class="category">游戏循环<ul class="category-list"><li><a href="Crafty-timer.html">Crafty.timer</a></li></ul></li><li class="category">图形<ul class="category-list"><li><a href="Canvas.html">Canvas</a></li><li><a href="CanvasLayer.html">CanvasLayer</a></li><li><a href="Color.html">Color</a></li><li><a href="Crafty-assignColor.html">Crafty.assignColor()</a></li><li><a href="Crafty-background.html">Crafty.background()</a></li><li><a href="Crafty-createLayer.html">Crafty.createLayer()</a></li><li><a href="Crafty-defaultShader.html">Crafty.defaultShader()</a></li><li><a href="Crafty-domHelper.html">Crafty.domHelper</a></li><li><a href="Crafty-pixelart.html">Crafty.pixelart()</a></li><li><a href="Crafty-sprite.html">Crafty.sprite()</a></li><li><a href="Crafty-WebGLShader.html">Crafty.WebGLShader()</a></li><li><a href="DOM.html">DOM</a></li><li><a href="DomLayer.html">DomLayer</a></li><li><a href="HTML.html">HTML</a></li><li><a href="Image.html">Image</a></li><li><a href="Particles.html">Particles</a></li><li><a href="Renderable.html">Renderable</a></li><li><a href="Sprite.html">Sprite</a></li><li><a href="Text.html">Text</a></li><li><a href="WebGL.html">WebGL</a></li><li><a href="WebGLLayer.html">WebGLLayer</a></li></ul></li><li class="category">输入<ul class="category-list"><li><a href="AreaMap.html">AreaMap</a></li><li><a href="Button.html">Button</a></li><li><a href="Crafty-findPointerEventTargetByComponent.html">Crafty.findPointerEventTargetByComponent()</a></li><li><a href="Crafty-keyboardDispatch.html">Crafty.keyboardDispatch()</a></li><li><a href="Crafty-keydown.html">Crafty.keydown</a></li><li><a href="Crafty-keys.html">Crafty.keys</a></li><li><a href="Crafty-lastEvent.html">Crafty.lastEvent</a></li><li><a href="Crafty-mouseButtons.html">Crafty.mouseButtons</a></li><li><a href="Crafty-mouseDispatch.html">Crafty.mouseDispatch()</a></li><li><a href="Crafty-mouseWheelDispatch.html">Crafty.mouseWheelDispatch()</a></li><li><a href="Crafty-multitouch.html">Crafty.multitouch()</a></li><li><a href="Crafty-selected.html">Crafty.selected</a></li><li><a href="Crafty-touchDispatch.html">Crafty.touchDispatch()</a></li><li><a href="Keyboard.html">Keyboard</a></li><li><a href="Mouse.html">Mouse</a></li><li><a href="MouseDrag.html">MouseDrag</a></li><li><a href="Touch.html">Touch</a></li></ul></li><li class="category">杂项<ul class="category-list"><li><a href="Crafty-addEvent.html">Crafty.addEvent()</a></li><li><a href="Crafty-device.html">Crafty.device</a></li><li><a href="Crafty-removeEvent.html">Crafty.removeEvent()</a></li><li><a href="Crafty-support.html">Crafty.support</a></li></ul></li><li class="category">模型<ul class="category-list"><li><a href="Model.html">Model</a></li></ul></li><li class="category">场景<ul class="category-list"><li><a href="Crafty-scene.html">Crafty.scene()</a></li></ul></li><li class="category">舞台<ul class="category-list"><li><a href="Crafty-background.html">Crafty.background()</a></li><li><a href="Crafty-scene.html">Crafty.scene()</a></li><li><a href="Crafty-viewport.html">Crafty.viewport</a></li></ul></li><li class="category">工具<ul class="category-list"><li><a href="Crafty-math.html">Crafty.math</a></li><li><a href="Delay.html">Delay</a></li><li><a href="Storage.html">Storage</a></li></ul></li></ul></div><div id="doc-content" class="doc-page-holder"><div class="doc-page"><h1>Text <span class="page-badge">组件</span></h1><div class="doclet" id="Text"><div class="triggered-events"><h4>事件</h4><div class="trigger-list"><dl class="trigger"><dt>Invalidate </dt><dd>当文本改变时</dd></dl></div></div><span class="markdown"><p>默认情况下,文本的样式为 "10px sans-serif".</p>
</span><div class="note"><span class="markdown"><p><strong>注意:</strong>一个具有文本组件的实体只能是文本！如果要在图像中写入文本，则需要文本的一个实体和图像的另一个实体。写文字在图像的技巧：（1）使用z-index（来自2D组件）确保文本在图像的顶部，而不是其他的方式；（2）使用 .attach()（来自2D组件）附着文本到图像使他们将一起移动或转动。</p>
</span></div><div class="note"><span class="markdown"><p><strong>注意:</strong> 对于 DOM (不包括 canvas) 文本实体, 各种字体的设置（例如 text-decoration）可以使用 <code>.css()</code> (见 DOM 组件)设置. 但不能设置被<code>.textFont()</code>,  <code>.textColor()</code>, 或 <code>.textAlign()</code> 控制的属性 -- 设置将会被忽略。</p>
</span></div><div class="note"><span class="markdown"><p><strong>注意:</strong>如果你使用高于标准字符的canvas文本，一部分符号可能会被裁剪。</p>
</span></div></div><div><h4>方法</h4><ul class="page-toc"><li><a href="#-dynamicTextGeneration">.dynamicTextGeneration()</a></li><li><a href="#-text">.text()</a></li><li><a href="#-textAlign">.textAlign()</a></li><li><a href="#-textColor">.textColor()</a></li><li><a href="#-textFont">.textFont()</a></li><li><a href="#-unselectable">.unselectable()</a></li></ul><div class="doclet" id="-dynamicTextGeneration"><a href="#doc-nav" class="doc-top">Back to top</a><h2 class="doclet-header">.dynamicTextGeneration()</h2><div class="crafty-method"><code class="signature"><span class="sig-phrase"><span class="sig-qualifier">public </span><span class="sig-qualifier">this </span><span class="sig-noun">.dynamicTextGeneration</span></span><span class="sig-seperator">(</span><span class="sig-phrase"><span class="sig-qualifier">bool </span><span class="sig-noun">dynamicTextOn</span></span><span class="sig-seperator">[,</span><span class="sig-phrase"><span class="sig-qualifier"> </span><span class="sig-qualifier">string </span><span class="sig-noun">textUpdateEvent</span></span><span class="sig-seperator">])</span></code><dl class="parameter"><dt> dynamicTextOn </dt><dd><span class="markdown"><p>一个标志，指示是否应打开或关闭动态文本。</p>
</span></dd></dl><dl class="parameter"><dt> textUpdateEvent </dt><dd><span class="markdown"><p>文本更新时触发的事件名称。默认为“EnterFrame”。（如果dynamicTextOn为false，这个参数没作用）</p>
</span></dd></dl></div><span class="markdown"><p>打开 (或 关闭) 实体的动态文本生成。动态文本生成将会打开，如果你调用<code>.text()</code> 方法时传递了文本生成函数，文本将会在每一帧都更新。</p>
<p>如果提供了 textUpdateEvent 文本生成将绑定到该事件，替换掉 "EnterFrame".</p>
</span><div class="note"><span class="markdown"><p><strong>注意:</strong>当实体附着在Canvas层时，动态生成文本可能导致性能问题。</p>
</span></div><div class="example"><h4>例子</h4><span class="markdown"><pre><code class="hljs ">Crafty.e(<span class="hljs-string">"2D, DOM, Text, Motion"</span>).attr({ <span class="hljs-attr">x</span>: <span class="hljs-number">100</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">100</span>, <span class="hljs-attr">vx</span>: <span class="hljs-number">10</span> })
    .text(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{ <span class="hljs-keyword">return</span> <span class="hljs-string">"My position is "</span> + <span class="hljs-keyword">this</span>._x })
    .dynamicTextGeneration(<span class="hljs-literal">true</span>)</code></pre><p>The above example will update the text with the entities position as it changes.</p>
</span></div></div><div class="doclet" id="-text"><a href="#doc-nav" class="doc-top">Back to top</a><h2 class="doclet-header">.text()</h2><div class="crafty-method"><code class="signature"><span class="sig-phrase"><span class="sig-qualifier">public </span><span class="sig-qualifier">this </span><span class="sig-noun">.text</span></span><span class="sig-seperator">(</span><span class="sig-phrase"><span class="sig-qualifier">String </span><span class="sig-noun">text</span></span><span class="sig-seperator">)</span></code><dl class="parameter"><dt> text </dt><dd><span class="markdown"><p>要插入到DOM或Canvas元素的文本</p>
</span></dd></dl></div><div class="crafty-method"><code class="signature"><span class="sig-phrase"><span class="sig-qualifier">public </span><span class="sig-qualifier">this </span><span class="sig-noun">.text</span></span><span class="sig-seperator">(</span><span class="sig-phrase"><span class="sig-qualifier">Function </span><span class="sig-noun">textGenerator</span></span><span class="sig-seperator">)</span></code><dl class="parameter"><dt> textGenerator </dt><dd><span class="markdown"><p>返回字符串的函数。它将在实体的上下文中立即调用，其结果为用作显示的文本。</p>
</span></dd></dl></div><span class="markdown"><p>这个方法将会更新实体内部的文本。</p>
<p>如果需要引用实体本身的属性，你应该传递函数而不是字符串。</p>
<p>如果动态文本是打开的，那么函数将会在需要的时候从新执行。</p>
</span><div><h4>参见</h4><ul class="see-also-list"><li><a href="#-dynamicTextGeneration">.dynamicTextGeneration</a></li></ul></div><div class="example"><h4>例子</h4><span class="markdown"><pre><code class="hljs ">Crafty.e(<span class="hljs-string">"2D, DOM, Text"</span>).attr({ <span class="hljs-attr">x</span>: <span class="hljs-number">100</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">100</span> }).text(<span class="hljs-string">"Look at me!!"</span>);

Crafty.e(<span class="hljs-string">"2D, DOM, Text"</span>).attr({ <span class="hljs-attr">x</span>: <span class="hljs-number">100</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">100</span> })
    .text(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{ <span class="hljs-keyword">return</span> <span class="hljs-string">"My position is "</span> + <span class="hljs-keyword">this</span>._x });

Crafty.e(<span class="hljs-string">"2D, Canvas, Text"</span>).attr({ <span class="hljs-attr">x</span>: <span class="hljs-number">100</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">100</span> }).text(<span class="hljs-string">"Look at me!!"</span>);

Crafty.e(<span class="hljs-string">"2D, Canvas, Text"</span>).attr({ <span class="hljs-attr">x</span>: <span class="hljs-number">100</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">100</span> })
    .text(<span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{ <span class="hljs-keyword">return</span> <span class="hljs-string">"My position is "</span> + <span class="hljs-keyword">this</span>._x });</code></pre></span></div></div><div class="doclet" id="-textAlign"><a href="#doc-nav" class="doc-top">Back to top</a><h2 class="doclet-header">.textAlign()</h2><div class="crafty-method"><code class="signature"><span class="sig-phrase"><span class="sig-qualifier">public </span><span class="sig-qualifier">this </span><span class="sig-noun">.textAlign</span></span><span class="sig-seperator">(</span><span class="sig-phrase"><span class="sig-qualifier">String </span><span class="sig-noun">alignment</span></span><span class="sig-seperator">)</span></code><dl class="parameter"><dt> alignment </dt><dd><span class="markdown"><p>文本的对齐方式</p>
</span></dd></dl></div><span class="markdown"><p>改变文本的对其方式。可用的值有 'start', 'end, 'left', 'center', 或 'right'.</p>
</span></div><div class="doclet" id="-textColor"><a href="#doc-nav" class="doc-top">Back to top</a><h2 class="doclet-header">.textColor()</h2><div class="crafty-method"><code class="signature"><span class="sig-phrase"><span class="sig-qualifier">public </span><span class="sig-qualifier">this </span><span class="sig-noun">.textColor</span></span><span class="sig-seperator">(</span><span class="sig-phrase"><span class="sig-qualifier">String </span><span class="sig-noun">color</span></span><span class="sig-seperator">)</span></code><dl class="parameter"><dt> color </dt><dd><span class="markdown"><p>颜色的名字, hex, rgb 或 rgba</p>
</span></dd></dl></div><span class="markdown"><p>修改文本的颜色。你可以使用 HEX, rgb and rgba 颜色值。</p>
<p>如果你想要文字透明，你应该使用rgba,它可以定义alpha通道。</p>
</span><div class="example"><h4>例子</h4><span class="markdown"><pre><code class="hljs ">Crafty.e(<span class="hljs-string">"2D, DOM, Text"</span>).attr({ <span class="hljs-attr">x</span>: <span class="hljs-number">100</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">100</span> }).text(<span class="hljs-string">"Look at me!!"</span>)
  .textColor(<span class="hljs-string">'#FF0000'</span>);

Crafty.e(<span class="hljs-string">"2D, Canvas, Text"</span>).attr({ <span class="hljs-attr">x</span>: <span class="hljs-number">100</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">100</span> }).text(<span class="hljs-string">'Look at me!!'</span>)
  .textColor(<span class="hljs-string">'rgba(0, 255, 0, 0.5)'</span>);

Crafty.e(<span class="hljs-string">"2D, Canvas, Text"</span>).attr({ <span class="hljs-attr">x</span>: <span class="hljs-number">100</span>, <span class="hljs-attr">y</span>: <span class="hljs-number">100</span> }).text(<span class="hljs-string">'Look at me!!'</span>)
  .textColor(<span class="hljs-string">'white'</span>);</code></pre></span></div><div><h4>参见</h4><ul class="see-also-list"><li><a href="Crafty-assignColor.html">Crafty.assignColor</a></li></ul></div></div><div class="doclet" id="-textFont"><a href="#doc-nav" class="doc-top">Back to top</a><h2 class="doclet-header">.textFont()</h2><div class="triggered-events"><h4>事件</h4><div class="trigger-list"><dl class="trigger"><dt>Invalidate </dt><dd></dd></dl></div></div><div class="crafty-method"><code class="signature"><span class="sig-phrase"><span class="sig-qualifier">public </span><span class="sig-qualifier">this </span><span class="sig-noun">.textFont</span></span><span class="sig-seperator">(</span><span class="sig-phrase"><span class="sig-qualifier">String </span><span class="sig-noun">key</span></span><span class="sig-seperator">,</span><span class="sig-phrase"><span class="sig-qualifier"> </span><span class="sig-qualifier">* </span><span class="sig-noun">value</span></span><span class="sig-seperator">)</span></code><dl class="parameter"><dt> key </dt><dd><span class="markdown"><p>实体要修改的属性</p>
</span></dd></dl><dl class="parameter"><dt> value </dt><dd><span class="markdown"><p>要设置的属性值</p>
</span></dd></dl></div><div class="crafty-method"><code class="signature"><span class="sig-phrase"><span class="sig-qualifier">public </span><span class="sig-qualifier">this </span><span class="sig-noun">.textFont</span></span><span class="sig-seperator">(</span><span class="sig-phrase"><span class="sig-qualifier">Object </span><span class="sig-noun">map</span></span><span class="sig-seperator">)</span></code><dl class="parameter"><dt> map </dt><dd><span class="markdown"><p>一个键是要修改的属性，值是要修改的属性值的对象。</p>
</span></dd></dl></div><span class="markdown"><p>此方法用来设置文本实体的字体属性。传递的值可以是: type, weight, size, family, lineHeight, 及其变量。</p>
<p>当使用canvas绘制时，lineHeight及其变量将会被忽略。</p>
</span><div class="example"><h4>例子</h4><span class="markdown"><pre><code class="hljs ">Crafty.e(<span class="hljs-string">"2D, DOM, Text"</span>).textFont({ <span class="hljs-attr">type</span>: <span class="hljs-string">'italic'</span>, <span class="hljs-attr">family</span>: <span class="hljs-string">'Arial'</span> });
Crafty.e(<span class="hljs-string">"2D, Canvas, Text"</span>).textFont({ <span class="hljs-attr">size</span>: <span class="hljs-string">'20px'</span>, <span class="hljs-attr">weight</span>: <span class="hljs-string">'bold'</span> });

Crafty.e(<span class="hljs-string">"2D, Canvas, Text"</span>).textFont(<span class="hljs-string">"type"</span>, <span class="hljs-string">"italic"</span>);
Crafty.e(<span class="hljs-string">"2D, Canvas, Text"</span>).textFont(<span class="hljs-string">"type"</span>); <span class="hljs-comment">// italic</span></code></pre></span></div></div><div class="doclet" id="-unselectable"><a href="#doc-nav" class="doc-top">Back to top</a><h2 class="doclet-header">.unselectable()</h2><div class="triggered-events"><h4>事件</h4><div class="trigger-list"><dl class="trigger"><dt>Invalidate </dt><dd></dd></dl></div></div><div class="crafty-method"><code class="signature"><span class="sig-phrase"><span class="sig-qualifier">public </span><span class="sig-qualifier">this </span><span class="sig-noun">.unselectable</span></span><span class="sig-seperator">()</span></code></div><span class="markdown"><p>此方法设置文本不能被拖动选择（高亮显示）。（Canvas 文本永远不能高亮显示，所以这只使用于DOM文本）通过修改css属性“user-select”及其变量来工作。</p>
<p>同样,这将设置鼠标的悬停形状为"default"(箭头),不是"text"(I字型)。</p>
</span><div class="example"><h4>例子</h4><span class="markdown"><pre><code class="hljs ">Crafty.e(<span class="hljs-string">"2D, DOM, Text"</span>).text(<span class="hljs-string">'This text cannot be highlighted!'</span>).unselectable();</code></pre></span></div></div></div></div></div></div>
			
		</div>
	</div>
	<div class="clearer"></div>
	<div id="footer">
		<div id="contact">
			<a href="https://groups.google.com/forum/#!forum/craftyjs">
				<img src="../images/google.png">
				google groups</a>
			<a href="mailto:starwed@gmail.com">
				<img src="../images/email.png">
				starwed@gmail.com</a>
			<a href="https://github.com/craftyjs/Crafty">
				<img src="../images/github.png">
				github</a>
		</div>
		<ul>
			<li><a href="../">首页</a></li>
				<li><a href="../getting-started/">快速开始</a></li>
				<li><a href="../documentation/">文档</a></li>
				<li><a href="../api/">API</a></li>
				<li><a href="../components/">组件</a></li>
				<li class="emph"><a href="../#install">下载</a></li>
		</ul>
		<p>
			© Crafty 2010-2015. Crafty is distributed under the <a href="http://en.wikipedia.org/wiki/MIT_License">MIT License</a>.
		</p>
	</div>
</div>


</body></html>